﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.RotatingSlidingAttachmentRotationAxisToVisibilityConverter
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows;
using System.Windows.Data;


namespace DnProcessSimulateCommands;

public class RotatingSlidingAttachmentRotationAxisToVisibilityConverter : IMultiValueConverter
{
  private readonly Dictionary<CApFLEXRotatingSlidingAttachmentRotationAxis, Visibility> m_rotationAxisToRegularVisibilityMap;
  private readonly Dictionary<CApFLEXRotatingSlidingAttachmentRotationAxis, PreviewVisibility> m_rotationAxisToPreviewVisibilityMap;

  public RotatingSlidingAttachmentRotationAxisToVisibilityConverter()
  {
    this.m_rotationAxisToRegularVisibilityMap = new Dictionary<CApFLEXRotatingSlidingAttachmentRotationAxis, Visibility>(3)
    {
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.X,
        Visibility.Hidden
      },
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.Y,
        Visibility.Hidden
      },
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.Z,
        Visibility.Hidden
      },
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.None,
        Visibility.Hidden
      }
    };
    this.m_rotationAxisToPreviewVisibilityMap = new Dictionary<CApFLEXRotatingSlidingAttachmentRotationAxis, PreviewVisibility>(3)
    {
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.X,
        PreviewVisibility.Always
      },
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.Y,
        PreviewVisibility.Always
      },
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.Z,
        PreviewVisibility.Always
      },
      {
        CApFLEXRotatingSlidingAttachmentRotationAxis.None,
        PreviewVisibility.Always
      }
    };
  }

  public void AssignRegularVisibilityToRotationAxis(
    CApFLEXRotatingSlidingAttachmentRotationAxis rotationAxis,
    Visibility regularVisibility)
  {
    this.m_rotationAxisToRegularVisibilityMap[rotationAxis] = regularVisibility;
  }

  public void AssignPreviewVisibilityToRotationAxis(
    CApFLEXRotatingSlidingAttachmentRotationAxis rotationAxis,
    PreviewVisibility previewVisibility)
  {
    this.m_rotationAxisToPreviewVisibilityMap[rotationAxis] = previewVisibility;
  }

  public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
  {
    CApFLEXRotatingSlidingAttachmentRotationAxis key = (CApFLEXRotatingSlidingAttachmentRotationAxis) values[0];
    bool flag = (bool) values[1];
    PreviewVisibility previewVisibility = this.m_rotationAxisToPreviewVisibilityMap[key];
    return (object) (Visibility) (previewVisibility == PreviewVisibility.Always || previewVisibility == PreviewVisibility.DuringPreview & flag || previewVisibility == PreviewVisibility.NotDuringPreview && !flag ? (int) this.m_rotationAxisToRegularVisibilityMap[key] : 1);
  }

  public object[] ConvertBack(
    object value,
    Type[] targetTypes,
    object parameter,
    CultureInfo culture)
  {
    throw new NotImplementedException();
  }
}
